{include file="public/headerbase" /}
{include file="public/left" /}
<div class="right-content">
	<ol class="breadcrumb we7-breadcrumb">
	<a href="./index.php?c=article&a=news&do=list&"><i class="wi wi-back-circle"></i> </a>
	<li>
		<a href="./index.php?c=article&a=news&do=list&">商品分类</a>
	</li>
	<li>
		添加分类
	</li>
</ol>
<div class="clearfix">
	<div  class="we7-form" role="form">
		
				<div id="tpl">
					<div class="form-group">
						<label class="col-xs-12 col-sm-2 col-md-2 control-label">商品分类</label>
						<div class="col-sm-8">
							<input type="text" class="form-control" name="cname" id="cname" vlaue="" placeholder="商品分类"/>
						</div>
					</div>
				</div>
		<div class="form-group">
			<div class="">
				<input type="submit" class="btn btn-primary" name="submit" value="提交" onclick="tijiao()" />
			</div>
		</div>
	</div>
</div>
</div>
<script>
	function tijiao(){
		if(!$.trim($(':text[name="cname"]').val())) {
				util.message('请填写商品类别', '', 'error');
				return false;
			}
		var cname=$('#cname').val();
		$.ajax({
	        url: "{:url('Cate/addxinxi')}",
	        data:{"cname":cname},
	        type: "post",
	        dataType: "json",
	        success: function (mega) {
	          if(mega==1){
	           		util.message('添加类别成功', "{:url('Cate/index')}", '');
	           }else{
	           		util.message('添加类别失败', '', '');
	           }
	        }
    	});
	}
	</script>
{include file="public/footer" /}